<%@ tag pageEncoding="UTF-8" 
body-content="scriptless"
description="分页标签"
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@ attribute name="id"            required="true"  rtexprvalue="true"  description="ID"%>
<%@ attribute name="pg"            required="true"  rtexprvalue="true"  type="com.pojo.Page" description="分页数据"%>
<%@ attribute name="pageCallback"  required="false" rtexprvalue="true"  description="点击页签的js回调函数"%>

<nav aria-label="Page navigation" id="${id}" data-page-no="${pg.pageNo}" data-page-size="${pg.pageSize}">
    <!-- data-page-no data-page-size-->
	<ul class="pagination pagination-sm justify-content-end">
		<li class="page-item ${pg.isFirst?'disabled' :''}" >
		   <a class="page-link"  onclick="${pageCallback}(${pg.pageNo-1})">${pg.pageNo}/${pg.totalPage}上页</a>
		</li>
		<c:forEach var="n" items="${pg.pageWindow}" varStatus="s">
			<li class="page-item ${n==pg.pageNo?'active':''}" >
			   <a class="page-link" href="#" onclick="${pageCallback}(${n})">${n}</a>
			</li>
		</c:forEach>
		<li class="page-item ${pg.isLast ?'disabled' :''}" >
		  <a class="page-link" href="#" onclick="${pageCallback}(${pg.pageNo+1})">下页</a>
		</li>
	</ul>
</nav>